#ifndef __SYS_PARAM_H__
#define __SYS_PARAM_H__

#include "n32l40x.h"

typedef enum{
    EYE_MODE = 1,
    FACE_MODE,
    BODY_MODE,
    HAIR_MODE,
    UART_TEST_MODE, //串口指令测试指定输出mode
    ALIGN_MODE,
    LIFT_MODE,
}WORK_MODE_e;


typedef enum{
    SLEEP_STA = 1,
    NORMAL_WORK_STA,
    CHARGE_STA,
    ERR_STA,
}DEVICE_STA_e;

typedef enum{
    LEVEL_0,
    LEVEL_1 = 1,
    LEVEL_2,
    LEVEL_3,
    LEVEL_4,
    LEVEL_5,
    LEVEL_6,
    LEVEL_7,
    LEVEL_8,
    LEVEL_9,
    LEVEL_10,
    LEVEL_MAX = LEVEL_10,
}LEVEL_e;

#define MAX_RUN_TIME    (15*60)

typedef enum{
    BLACK_COLOR = 0,
    WHITE_COLOR,
    RED_COLOR,
    GREEN_COLOR,
    BLUE_COLOR,
    PURPLE_COLOR,
}RGB_COLOR_e;



typedef struct 
{
    char sys_power_on_flag;
    char sys_power_off_flag;
    char beep_on_flag;
    char motor_on_flag;
    char led_refresh_flag;
    int beep_finish_flag;
    int beep_on_cnt;
    int motor_on_cnt;
    char task_1ms_flag;
    char task_20us_flag;
    int run_time;
    int bat_val;
    DEVICE_STA_e sta;
    WORK_MODE_e mode;
    LEVEL_e level;
    RGB_COLOR_e rgb_color;

    
    /* data */
}SYS_PARAM_t;

extern SYS_PARAM_t sys_data;

int get_sys_battery_voltage(void);
void set_sys_battery_voltage(int bat_val);

RGB_COLOR_e get_sys_rgb_color(void);
void set_sys_rgb_color(RGB_COLOR_e color);

LEVEL_e get_sys_level(void);
void set_sys_level(LEVEL_e level);

WORK_MODE_e get_sys_mode(void);
void set_sys_mode(WORK_MODE_e mode);

#endif

